package com.lqian.simplestructure.linearlist;


import java.util.HashSet;
import java.util.Set;

public class Code01 {

    public static void main(String[] args) {
        testArrayIntersectionA();

    }

    public static void testArrayIntersectionA() {
        int[] arrayA = new int[]{1, 1, 2, 3, 4, 4, 5, 1, 1};
        int[] arrayB = new int[]{11, 1, 22, 3, 43, 4, 5, 11, 1, 22};

        Set<Integer> intersectionSet = new HashSet();

        for (int i = 0; i < arrayA.length; i++) {
            for (int j = 0; j < arrayB.length; j++) {
                if (arrayA[i] == arrayB[j]) {
                    intersectionSet.add(arrayA[i]);
                }
            }
        }
        System.out.println(intersectionSet);
    }


}


